package com.mengwen.backstage.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author LiangYonghui
 * @date 2020/4/8 18:49
 * @description 邀请表数据访问层
 */
@Repository
@Mapper
public interface InvitationMapper {
    @Select("SELECT * FROM invitation WHERE inviter_unionid = #{inviterUnionid}")
    List<String> findInvitee(String inviterUnionid);

    /**
     * 根据被邀请者的unionid查询邀请人的unionid
     * @param unionid
     * @return
     */
    @Select("SELECT inviter_unionid FROM invitation WHERE invitee_unionid = #{unionid}")
    String findInviterUnionidByInviteeUnionid(String unionid);
}
